#文件去重
import shutil
import os
f_read = input("请输入待处理的文件名:")
f_write=f_read.split('.')[0]+'_norepeat.txt'
if os.path.exists(f_read):
    lines_seen=set()
    outfiile=open(f_write,'w',encoding='utf-8')
    f=open(f_read,'r',encoding='utf-8')
    for line in f:
        if line not in lines_seen:
            outfiile.write(line)
            lines_seen.add(line)
    print('finish')
else:
    print("文件不存在，请检查输入")